package com.backend.demo.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.backend.demo.dao.RoleDao;
import com.backend.demo.entities.Role;
import com.backend.demo.service.IRoleService;

/**
 * 角色service Impl
 * @author Administrator
 * 	
 */
@Service("roleService")
public class RoleServiceImpl implements IRoleService {

	@Resource(name="roleDao")
	private RoleDao roleDao;
	
	@Override
	public List<Role> getAllRoles() {
		return roleDao.getAllRoles();
	}

	@Override
	public List<Role> getRolesByCondition(Role role) {
		return roleDao.getRolesByCondition(role);
	}

	@Override
	public Role getRoleById(long roleID) {
		return roleDao.getRoleById(roleID);
	}

	@Override
	public int addRole(Role role) {
		return roleDao.addRole(role);
	}

	@Override
	public int updateRole(Role role) {
		return roleDao.updateRole(role);
	}

	@Override
	public int delete(long roleID) {
		return roleDao.deleteById(roleID);
	}

}
